* Gary LaMotte's Mathematica solutions to exercises from the 2012 Gravitational Wave Astronomy Summer School

*DAY 5 PART1 DATA A*

*1.  BURST SEARCH USING EXCESS POWER*

*a.*

samprate = 16384;

dataA =  Flatten[Import["C:\\Users\\Gary LaMotte\\Documents\\Shawhan GW Lectures and Exercises\\day5dataA.txt", "Table"]];

dataAsecs = Length[dataA]/samprate

ndataA = Length[dataA]

tdataA =  Table[(r-1.0)/samprate  , {r,Length[dataA]}];

*b. and d.*

*FOR DATAA*

*BELOW:  SIMULATED BUTTERWORTH FILTER BY USING SQUARE BANDPASS FILTER 64 TO 128 Hz*

*SUCCESSFUL SQUARE WINDOW FILTER DESIGN IN FREQUENCY DOMAIN,INVERSE FOURIER TRANSFORMED TO THE TIME DOMAIN (SINC FUNCTION)AND CONVOLVED  WITH TIME SERIES*

*SQUARE FILTER PART*

*64Hz is mapped to 1024 by multiplying by a factor of 16 and 128Hz is mapped to 2048 in the same manner.  This technique allows the inverse fourier transformed square bandpass filter to be convolved with the data.*

*Square Filter Subprogram:*

passband[lowcorn_,upcorn_]:=
(start = {1,1}; pass = PadRight[start, ((upcorn - lowcorn)*dataAsecs)+1, 1]; rtside = PadRight[pass, ndataA-((lowcorn*dataAsecs)-1),0]; sqfilt = PadLeft[rtside,ndataA];  
sinc = InverseFourier[sqfilt]; realsinc = (1./512.) * Re[sinc]; convts = ListConvolve[realsinc,dataA,1]; 
sincts = Transpose[{tdataA, convts}];  ListLinePlot[sincts, PlotLabel -> upcorn DataA Filter BandPass, AxesLabel ->  {Time (Secs), Amplitude},PlotRange->{{0,16}, {-.16,.16}}])

*Input the following into the Square Filter Subprogram:*

increment = 64;

lowcorn =  64;

upcorn = 128;

passband[lowcorn,upcorn]

lowcorn = lowcorn+increment;  upcorn = upcorn +increment; passband[lowcorn,upcorn]

lowcorn = lowcorn+increment;  upcorn = upcorn +increment; passband[lowcorn,upcorn]

lowcorn = lowcorn+increment;  upcorn = upcorn +increment; passband[lowcorn,upcorn]

lowcorn = lowcorn+increment;  upcorn = upcorn +increment; passband[lowcorn,upcorn]

lowcorn = lowcorn+increment;  upcorn = upcorn +increment; passband[lowcorn,upcorn]

lowcorn = lowcorn+increment;  upcorn = upcorn +increment; passband[lowcorn,upcorn]

lowcorn = lowcorn+increment;  upcorn = upcorn +increment; passband[lowcorn,upcorn]

lowcorn = lowcorn+increment;  upcorn = upcorn +increment; passband[lowcorn,upcorn]

lowcorn = lowcorn+increment;  upcorn = upcorn +increment; passband[lowcorn,upcorn]

lowcorn = lowcorn+increment;  upcorn = upcorn +increment; passband[lowcorn,upcorn]

lowcorn = lowcorn+increment;  upcorn = upcorn +increment; passband[lowcorn,upcorn]

lowcorn = lowcorn+increment;  upcorn = upcorn +increment; passband[lowcorn,upcorn]

lowcorn = lowcorn+increment;  upcorn = upcorn +increment; passband[lowcorn,upcorn]

lowcorn = lowcorn+increment;  upcorn = upcorn +increment; passband[lowcorn,upcorn]

ListAnimate[{%,%%,%%%,%%%%,%%%%%,%%%%%%,%%%%%%%,%%%%%%%%,%%%%%%%%%,%%%%%%%%%%,%%%%%%%%%%%,%%%%%%%%%%%%,%%%%%%%%%%%%%,%%%%%%%%%%%%%%,%%%%%%%%%%%%%%%}]

*Convincing signals in both data sets are at 2.3, 6.9, 13.3 and possibly at 8.4 seconds.*